import { Teacher } from '../models/teacher.model';
import { Course } from '../models/course.model';
import { teachers } from '../mock/teacher.mock';
import { courses } from '../mock/course.mock';

export class TeacherService {
    async getTeachers(): Promise<Teacher[]> {
        return teachers;
    }

    async getTeacherById(id: number): Promise<Teacher | null> {
        return teachers.find(teacher => teacher.id === id) || null;
    }

    async getTeacherCourses(teacherId: number): Promise<Course[]> {
        return courses.filter(course => course.teacherId === teacherId);
    }
}
